﻿
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using 纺织贸易管理系统;
using FastReport;
using System.Windows.Forms;
using PrintLabel.Tools;

namespace Tools
{
    public class ReportService
    {
        public static void Print(DataSet ds, PrintSetting printSetting)
        {
            Report fs = new Report();
            try
            {
                fs.RegisterData(ds);
                fs.Load(printSetting.Path);
                switch (printSetting.PrintUseful)
                {
                    case PrintUseful.Privew:
                        fs.Show();
                        break;
                    case PrintUseful.Design:
                        fs.Design();
                        break;
                }
            }
            catch(Exception ex)
            {
               ShowMessage.ShowErrorMessagebox(new Form(), ex.Message);
            }
        }
      
    }
}
